import request from "@/services/request.ts";

/**
 * 项目管理
 */
export const projectList  = async ()=>{
    return request.get('/project')
}
export const projectDetail = async (id:number)=>{
    return request.get(`/project/${id}`)
}

export const projectCreate = async (data:object)=>{
    return request.post('/project',data)
}

export const projectUpdate = async (id:number,data:object)=>{
    return request.put(`/project/${id}`,data)
}

export const projectDelete = async (id:number)=>{
    return request.del(`/project/${id}`)
}

/**
 * 项目分类
 */
export const projectCategory = async ()=>{
    return request.get('/project/category')
}
export const projectCategoryCreate = async (data:object)=>{
    return request.post('/project/category',data)
}
export const projectCategoryUpdate = async (id:number,data:object)=>{
    return request.put(`/project/category/${id}`,data)
}
export const projectCategoryDelete = async (id:number)=>{
    return request.del(`/project/category/${id}`)
}
/**
 * 项目状态
 */
export const projectStatus = async ()=>{
    return request.get('/project/status')
}
export const projectStatusCreate = async (data:object)=>{
    return request.post('/project/status',data)
}
export const projectStatusUpdate = async (id:number,data:object)=>{
    return request.put(`/project/status/${id}`,data)
}
export const projectStatusDelete = async (id:number)=>{
    return request.del(`/project/status/${id}`)
}